#!/usr/bin/perl
use English;

open (FILE,"re4.txt") or die "re4.txt nicht vorhanden";
while ($a = <FILE>) {
        if ($a =~ m/(hallo(?=xxx)|morgen(?=yy))... hallo/) {
                print $PREMATCH . "|" . $MATCH . "|" . $POSTMATCH;
                #print $` . ":" . $& . ":" . $';
        }
}
close (FILE);
